package com.young.domain;


public enum JobScheduleStatusEnum {
    FIRE(-1, "启动"), SCHEDULE_SUC(0, "调度成功，运行中"), SUCCESS(1, "任务成功"), FAIL(2, "任务失败"), SCHEDULE_FAIL(3, "调度失败"), CLIENT_CLOSE(4, "执行节点关闭");
    private int status;
    private String desc;

    JobScheduleStatusEnum(int status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public int getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }

    public static JobScheduleStatusEnum find(int status) {

        for (JobScheduleStatusEnum en : JobScheduleStatusEnum.values()) {
            if (en.getStatus() == status) {
                return en;
            }
        }

        return null;
    }
}
